<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %><%--
  Created by IntelliJ IDEA.
  User: 白菜你个cabbage
  Date: 2019/12/8
  Time: 15:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购物车页面</title>
</head>
<body>
这是你的购物车<p></p>
你购买的物品为：<br>书名---------数量<p>
        <%
    String url = "jdbc:sqlserver://localhost:1433;DataBaseName=Login;integratedSecurity=true;";
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection comm = DriverManager.getConnection(url);
    String sql = "select * from Book";
    System.out.println("a");
    Statement st = comm.createStatement();
    ResultSet rs = st.executeQuery(sql);
    while(rs.next()){
        out.println(rs.getString(1));
        out.println("----------"+rs.getString(2)+"<br>");
    }
    rs.close();
    //6 关闭sql对象
    st.close();
    //7 关闭连接
    comm.close();
%>
    <%--选择你要清空购物车的操作<br>--%>
<form action="Experiment/delectCar" method="post">
    <%--    <input type="submit" name="delAll" value="清除购物车"><br>--%>
    <a href="market.jsp">购买其他的</a><br>
    请输入你要修改的物品<input type="text" name="delIt">
    <%--    选择你需要的操作：<input type="checkbox" name="java">--%>
    <%--    <input type="button" value="-">--%>
    修改的数量<input type="number" value="0" name="num"><br>
    <%--    <input type="button" value="+">--%>
    清除购物车<input type="checkbox" name="del"><br>
    <input type="submit" value="提交">
    <p></p>
</form>
</body>
</html>
